/*
 * @Description: 
 * @version: 1.0
 * @Author: ziwei
 * @Date: 2021-08-14 22:57:36
 * @LastEditors: ziwei
 * @LastEditTime: 2021-08-14 23:19:34
 */
import {Redirect} from 'umi'

function Auth(props){
    console.log('porps',props);
    let isLogin = localStorage.getItem('isLogin');
    if(isLogin){
        return props.children
    }else{
        return <Redirect to={{pathname:'/login',state:{from:props.location.pathname}}}></Redirect>
    }
}

export default Auth;